package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TA_PART_MEDIDA_CAUTELAR_PJ database table.
 * 
 */
@Embeddable
public class TaPartMedidaCautelarPjPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String coRegiPres;
	private String coOficRgstPres;
	private String aaHojaPres;
	private String nuHojaPres;
	private String numPartida;
	private String codArea;

    public TaPartMedidaCautelarPjPK() {
    }

	@Column(name="CO_REGI_PRES", unique=true, nullable=false, length=2)
	public String getCoRegiPres() {
		return this.coRegiPres;
	}
	public void setCoRegiPres(String coRegiPres) {
		this.coRegiPres = coRegiPres;
	}

	@Column(name="CO_OFIC_RGST_PRES", unique=true, nullable=false, length=2)
	public String getCoOficRgstPres() {
		return this.coOficRgstPres;
	}
	public void setCoOficRgstPres(String coOficRgstPres) {
		this.coOficRgstPres = coOficRgstPres;
	}

	@Column(name="AA_HOJA_PRES", unique=true, nullable=false, length=4)
	public String getAaHojaPres() {
		return this.aaHojaPres;
	}
	public void setAaHojaPres(String aaHojaPres) {
		this.aaHojaPres = aaHojaPres;
	}

	@Column(name="NU_HOJA_PRES", unique=true, nullable=false, length=8)
	public String getNuHojaPres() {
		return this.nuHojaPres;
	}
	public void setNuHojaPres(String nuHojaPres) {
		this.nuHojaPres = nuHojaPres;
	}

	@Column(name="NUM_PARTIDA", unique=true, nullable=false, length=8)
	public String getNumPartida() {
		return this.numPartida;
	}
	public void setNumPartida(String numPartida) {
		this.numPartida = numPartida;
	}

	@Column(name="COD_AREA", unique=true, nullable=false, length=5)
	public String getCodArea() {
		return this.codArea;
	}
	public void setCodArea(String codArea) {
		this.codArea = codArea;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TaPartMedidaCautelarPjPK)) {
			return false;
		}
		TaPartMedidaCautelarPjPK castOther = (TaPartMedidaCautelarPjPK)other;
		return 
			this.coRegiPres.equals(castOther.coRegiPres)
			&& this.coOficRgstPres.equals(castOther.coOficRgstPres)
			&& this.aaHojaPres.equals(castOther.aaHojaPres)
			&& this.nuHojaPres.equals(castOther.nuHojaPres)
			&& this.numPartida.equals(castOther.numPartida)
			&& this.codArea.equals(castOther.codArea);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coRegiPres.hashCode();
		hash = hash * prime + this.coOficRgstPres.hashCode();
		hash = hash * prime + this.aaHojaPres.hashCode();
		hash = hash * prime + this.nuHojaPres.hashCode();
		hash = hash * prime + this.numPartida.hashCode();
		hash = hash * prime + this.codArea.hashCode();
		
		return hash;
    }
}